import {
  SET_USER_PROFILE_DEFAULT_SCENARIO,
  SET_USER_PROFILE_ALL_WAREHOUSES,
  SET_USER_PROFILE_TENANT_LIST
} from "./action-types";

const initialState = {
  defaultScenario: null,

  allWarehouses: [],

  userTenants: []
};

const data = (state = initialState, action) => {
  switch (action.type) {
    case SET_USER_PROFILE_DEFAULT_SCENARIO:
      return { ...state, defaultScenario: action.payload.items };
    case SET_USER_PROFILE_ALL_WAREHOUSES:
      return { ...state, allWarehouses: action.payload.items };
    case SET_USER_PROFILE_TENANT_LIST:
      return { ...state, userTenants: action.payload.items };
    default:
      return state;
  }
};

export default data;
